home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / sys / amiga / programmer / 6914 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  2.5 KB

  1. Path: red-branch.MIT.EDU!not-for-mail
  2. From: rid@red-branch.MIT.EDU (Shawna or Lars Hansen)
  3. Newsgroups: comp.sys.amiga.programmer
  4. Subject: Re: Timing stuff
  5. Date: 5 Apr 1996 02:09:40 GMT
  6. Organization: Massachvsetts Institvte of Technology
  7. Message-ID: <4k1vd4$hbc@senator-bedfellow.MIT.EDU>
  8. References: <9604012043.AA003vp@ozzy.demon.co.uk> <4jsinv$9mi@senator-bedfellow.MIT.EDU> <9604031318.AA003wm@ozzy.demon.co.uk>
  9. NNTP-Posting-Host: red-branch.mit.edu
  10. X-Newsreader: TIN [UNIX 1.3 950824BETA PL0]
  11.  
  12. Brian Skreeg (oz@ozzy.demon.co.uk) wrote on Wed, 3 Apr 96 13:18:07 GMT:
  13. : While smelling of fish Shawna or Lars Hansen (rid@red-branch.MIT.EDU) wrote:
  14. : : timer.device
  15. : Thought as much, but could you possibly elaborate a little. I looked at the
  16. : autodocs for it but couldn't make head nor tail of how it works.                                               
  17. :    __ _ _                
  18. :   /  \ \ \ 
  19. :  / / / / / |-Brian Skreeg--------------IRC:_Ozzy-|
  20. :  \__/  \ \ |-Lead guitarist---Widdles on request-|
  21. :     \__/_/ |-A fish or two is with no compromise-|
  22. Ah, well, I don't have my Amiga up and running at the moment, but I think 
  23. I can give you a few pointers...
  24.  
  25. Check out the include-file for the timer.device (should be device/timer.h 
  26. or something like that. That'll give you the necessary commands you need 
  27. to send to the device to set it up. It might also contain a specialized 
  28. IOstruct (can't remember exactly). Then, check your autodocs for usage on 
  29. OpenDevice, SendIO and AbortIO. You'll need the OpenDevice() command to 
  30. get a connection to the device, and the SendIO to set it up. The 
  31. timer.device will give you a signal as soon as the requested time is up. 
  32. At this time, you will have to send another request for a new 'delay' 
  33. before the next signal. 
  34.  
  35. I assume that you will have some sort of loop in your program, so all you 
  36. have to do, is to check for the signal from the device.. If you set it at 
  37. 10 seconds, you'll get a signal ten seconds later...Neat, huh? :)
  38.  
  39. Additional help can be obtained from viewing code which uses this device. 
  40. Perfmeter is a good example. It uses two timers, so keep your eyes open...
  41. Also, the ACE manual has a fairly good explanation of the use of the 
  42. timer.device. Personally, I peeked at Perfmeter (check the Aminet site at 
  43. a site near you...), and found it invalueable.
  44.  
  45. Or, you could wait until I get my amiga hooked up to the net, and get my 
  46. DateDiary program w/source to see how I used two timers ... But don't 
  47. hold your breath.......
  48.  
  49. -- 
  50. * Lars M. Hansen              
  51.